<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>前后端调用</title>
	</head>
	<body>
		<h1>前后端调用</h1>
		<script src="../js/axios.js"></script>
		<script>
			let url1="http://localhost:8090/axios/getUserById?id=1"
			axios.get(url1).then(promise =>{
				console.log(promise.data)
			})
			
			let sex = "女"
			let age = 18
			let url2 = `http://localhost:8090/axios/user/${sex}/${age}`
			axios.get(url2).then(promise=>{
				console.log(promise.data)
			})
			/*  */
			let user = {
				name: "王昭君",
				age: 19,
				sex: "女"
			}
			let url3 = "http://localhost:8090/axios/getUser"
			axios.get(url3,{params:user}).then(promise=>{
				console.log(promise.data)
			})
		</script>
	</body>
</html>
